﻿using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using TrackIT.Common.Repositories;

namespace TrackIT.UnitTest.Repositories
{
    [ExcludeFromCodeCoverage]
    internal sealed class MockFileAccessRepository : IFileAccessRepository
    {
        public List<string> Items;

        public MockFileAccessRepository()
        {
            Items = new List<string>();
        }

        public void Save(List<string> items, string filename)
        {
            Items = items;
        }

        public IEnumerable<string> Load(string filename)
        {
            return Items.AsEnumerable();
        }

        public void Clear()
        {
            Items.Clear();
        }
    }
}
